Class Deck

java.lang.Object
  extended by Deck

public class Deck
extends java.lang.Object

Deck models a deck of 52 Anglo-American playing cards.

Version:
1.1 October 11, 2012, May 24, 2016
Author:
Lynn Marshall, Aly Moursy

Constructor Summary
Deck()
          Constructs a new, unshuffled deck containing 52 playing cards.
 
Method Summary
 Card dealCard()
          Removes a card from this deck.
 boolean isEmpty()
          Determines if this deck is empty.
 void shuffle()
          Shuffles this deck of cards.
 int size()
          Returns the number of cards that are currently in the deck.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deck

public Deck()
Constructs a new, unshuffled deck containing 52 playing cards.

Method Detail

dealCard

public Card dealCard()
Removes a card from this deck.

Returns:
the card at the top of the deck

isEmpty

public boolean isEmpty()
Determines if this deck is empty.


shuffle

public void shuffle()
Shuffles this deck of cards.


size

public int size()
Returns the number of cards that are currently in the deck.